package org.makcro.sms.services.chat.base.dao;

import javax.persistence.NoResultException;

import org.makcro.sms.services.chat.model.BulkMessage;

public class JpaBulkMessageDaoImpl extends AbstractDAO<BulkMessage> implements BulkMessageDao {

	public JpaBulkMessageDaoImpl() {
		super( BulkMessage.class );
	}

	@Override
	public BulkMessage findByCoreId(Long coreId) {
		BulkMessage result;
		try {
			result = (BulkMessage) entityManager.createNamedQuery( "BulkMessage.FindByCoreId" ).setParameter( "coreId", coreId ).getSingleResult();
		}
		catch (NoResultException e) {
			result = null;
		}
		return result;
	}

	

}
